package cn.school.service;

import cn.school.dao.GradeMapper;
import cn.school.entity.Grade;
import cn.school.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * servlet ->Service=>Mapper
 */
public class GradeService {

    public static final GradeService INST=new GradeService();

    public List<Grade> findALL(){
        SqlSession s= MybatisUtil.get();
        try {
            return s.getMapper(GradeMapper.class).findALL();
        }finally {
            MybatisUtil.close(s);
        }
    }

}
